<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="../../zxt/zxt.js"></script>
		<script>
			importZXT("../../zxt");
		</script>

	</head>

	<body class="bodyBackground">
		<div style="width:600px;" id="socket"  zxt="zxt.ui.Region" zxt.configFunc="configFieldset" zxt.title="文章阅读" zxt.state="1">

			<p>
				A researcher noted that the power shortage won't last long since it's caused mainly by the abnormal weather.
			</p>
			<p>
				A researcher noted that the power shortage won't last long since it's caused mainly by the abnormal weather.
			</p>
			<p>
				A researcher noted that the power shortage won't last long since it's caused mainly by the abnormal weather.
			</p>

		</div>

		<table>
        	<tr>
				<td>getType()</td>
				<td>返回按钮的控件类型</td>
				<td><input type="button" name="getType" value="getType" 
					onclick="alert('region控件的type为'+$zxtUI.socket.getType());"/></td>
			</tr>
			<tr>
				<td>addElement(elem)</td>
				<td>插入传入的DOM元素</td>
				<td><input type="button" name="addElement" value="addElement" 
					onclick="$zxtUI.socket.addElement('<div>addElement</div>');alert('region控件增加了dom节点');"/></td>
			</tr>
			<tr>
				<td>addWidget(widget)</td>
				<td>向内部添加widget控件。</td>
				<td><input type="button" name="addWidget" value="addWidget" 
					onclick="var btn = new zxt.ui.Button('edit1', 'EDIT1');btn.onClick = function(){alert('HA');};$zxtUI.socket.addWidget(btn);alert('region控件增加了控件');"/></td>
			</tr>
			<tr>
				<td>close()</td>
				<td>折叠区域控件。</td>
				<td><input type="button" name="close" value="close" 
					onclick="$zxtUI.socket.close();alert('region控件折叠了');"/></td>
			</tr>
			<tr>
				<td>open()</td>
				<td>展开区域控件。</td>
				<td><input type="button" name="open" value="open" 
					onclick="$zxtUI.socket.open();alert('region控件展开了');"/></td>
			</tr>
			<tr>
				<td>width(v)</td>
				<td>(int) [GETTER | SETTER] 宽度</td>
				<td><input type="button" name="width" value="width" 
					onclick="alert('region控件的width为'+$zxtUI.socket.width());"/></td>
			</tr>
        </table>
        
		<div>
			<a href="../index.html">返回</a>
		</div>
	</body>
</html>

<script type="text/javascript">
	$zxt.init();

	function configFieldset(fieldset) {
		var btn = new zxt.ui.Button("edit", "EDIT");
		btn.onClick = function() {
			alert("HA");
		}
		fieldset.addWidget(btn);
	}

</script>